package com.naiterui.ehp.bs.weixin.subscribe;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 发货通知
 *
 * @author yangfuya
 * @version 1.0
 * @date 2021/5/26 17:47
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@AllArgsConstructor
public class ShipNoticeSubscribe extends BaseSubscribe {

    private static final long serialVersionUID = 6097211606345978024L;

    /**
     * 订单编号
     */
    private String orderNumber;

    /**
     * 快递公司
     */
    private String expressDeliveryCompany;

    /**
     * 快递单号
     */
    private String expressDeliveryNumber;

    /**
     * 订单商品
     */
    private String orderItem;

    /**
     * 备注
     */
    private String remarks;

    @Override
    public String getTemplateLabel() {
        return "SHIP_NOTICE";
    }

    @Override
    public void handleContent(List<SubscribeProperties.Content> contentList) {
        Map<String, String> formatMap = new HashMap<>(9);
        formatMap.put("ORDER_NUMBER", getOrderNumber());
        formatMap.put("EXPRESS_DELIVERY_COMPANY", getExpressDeliveryCompany());
        formatMap.put("EXPRESS_DELIVERY_NUMBER", getExpressDeliveryNumber());
        formatMap.put("ORDER_ITEM", getOrderItem());
        formatMap.put("REMARKS", getRemarks());
        super.formatData(contentList, formatMap);
    }
}
